import { createRouter, createWebHistory } from 'vue-router';
import Home from '@/views/Home.vue';
import GpHome from '@/views/GpHome.vue';
import T100Home from '@/views/T100Home.vue';
import AutoGpApi from '@/views/gp_views/AutoGpApi.vue';
import QueryApi from '@/views/gp_views/QueryApi.vue';
import SingleDoc from '@/views/gp_views/SingleDoc.vue';
import DoubleDoc from '@/views/gp_views/DoubleDoc.vue';
import FormDesigner from '@/views/gp_views/FormDesigner.vue';
import JsonToRecord from '@/views/json_to_record/JsonToRecord.vue';
import ErrorCodeConverter from '../components/ErrorCodeConverter.vue';
import ErrorMessages from '@/views/error_code/ErrorMessages.vue';
import AutoGpFakeDouble from '@/views/gp_views/AutoGpFakeDouble.vue';

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/gp',
    name: 'GpHome',
    component: GpHome
  },
  {
    path: '/t100',
    name: 'T100Home',
    component: T100Home
  },
  {
    path: '/gp/api',
    name: 'AutoGpApi',
    component: AutoGpApi
  },
  {
    path: '/gp/query',
    name: 'QueryApi',
    component: QueryApi
  },
  {
    path: '/gp/single',
    name: 'SingleDoc',
    component: SingleDoc
  },
  {
    path: '/gp/fakedouble',
    name: 'AutoGpFakeDouble',
    component: AutoGpFakeDouble
  },
  {
    path: '/gp/double',
    name: 'DoubleDoc',
    component: DoubleDoc
  },
  {
    path: '/gp/form',
    name: 'FormDesigner',
    component: FormDesigner
  },
  {
    path: '/json-to-record',
    name: 'JsonToRecord',
    component: JsonToRecord,
    meta: {
      title: 'JSON转Record工具'
    }
  },
  {
    path: '/error-code-converter',
    name: 'ErrorCodeConverter',
    component: ErrorCodeConverter,
    meta: {
      title: '错误代码转换工具'
    }
  },
  {
    path: '/error-messages',
    name: 'ErrorMessages',
    component: ErrorMessages
  }
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
});

export default router;